473,597 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Right Click Menu

Using the following code I am able to open a new window when a user right
clicks an object in my document.

if (window.event.b utton == 2) {
Win1 = window.open("", "","height=200, width=200");
Win1.document.w rite('Right click!');
}

The problem is that the default menu that normally appears is still
appearing. How do I suppress the right-click menu?

Thank you
Glenn

Jul 23 '05 #1
5 2294
"MisterG" <gl**********@r ogers.com> wrote in message
news:Ir******** ************@ro gers.com...
Using the following code I am able to open a new window when a user right
clicks an object in my document.

if (window.event.b utton == 2) {
Win1 = window.open("", "","height=200, width=200");
Win1.document.w rite('Right click!');
}

The problem is that the default menu that normally appears is still
appearing. How do I suppress the right-click menu?

Thank you
Glenn


Initially I did this by inserting a clear 1x1 px gif at the mouse point
while the mouse was down. There is an easier way to do it however by
canceling the event. Can't seem to remember the trick off the top of my head
though. I should have a copy stored on my home computer...but in the mean
time i found this:

http://www.javascriptkit.com/script/...lickmenu.shtml

--
Matthew Hagston
Jul 23 '05 #2
Thank you. That's all I needed!

"Matthew Hagston" <ot***@earthlin k.net> wrote in message
news:yf******** ******@newsread 2.news.atl.eart hlink.net...
"MisterG" <gl**********@r ogers.com> wrote in message
news:Ir******** ************@ro gers.com...
Using the following code I am able to open a new window when a user right clicks an object in my document.

if (window.event.b utton == 2) {
Win1 = window.open("", "","height=200, width=200");
Win1.document.w rite('Right click!');
}

The problem is that the default menu that normally appears is still
appearing. How do I suppress the right-click menu?

Thank you
Glenn

Initially I did this by inserting a clear 1x1 px gif at the mouse point
while the mouse was down. There is an easier way to do it however by
canceling the event. Can't seem to remember the trick off the top of my

head though. I should have a copy stored on my home computer...but in the mean
time i found this:

http://www.javascriptkit.com/script/...lickmenu.shtml

--
Matthew Hagston

Jul 23 '05 #3
Matthew Hagston wrote:
"MisterG" <gl**********@r ogers.com> wrote in message
news:Ir******** ************@ro gers.com...
Using the following code I am able to open a new window when a user right
clicks an object in my document.

if (window.event.b utton == 2) {
Win1 = window.open("", "","height=200, width=200");
Win1.document.w rite('Right click!');
}
Only in IE. There is no attempt to make it work in browsers that
don't support window.event and it will be defeated by pop-up
blockers.

It likely won't work on systems that implement right mouse button
functionality without actually having one.

The problem is that the default menu that normally appears is still
appearing. How do I suppress the right-click menu?

Thank you
Glenn

Initially I did this by inserting a clear 1x1 px gif at the mouse point
while the mouse was down. There is an easier way to do it however by
canceling the event. Can't seem to remember the trick off the top of my head
though. I should have a copy stored on my home computer...but in the mean
time i found this:

http://www.javascriptkit.com/script/...lickmenu.shtml


That is IE specific code that does not work in any browser that does
not support "window.createP opup", that has a pop-up blocker enabled
or has JavaScript disabled.

Changing the default behaviour of the user's interface only creates
confusion, what is the point?
--
Zif
Jul 23 '05 #4
Maybe for the internet, but this is an in intranet application requiring
custom functionality, distributed on a standardized platform ( IE ). So it's
perfect for our purposes.

Thanks

"Zifud" <Zi***@hotmail. com> wrote in message
news:Lu******** ********@news.o ptus.net.au...
Matthew Hagston wrote:
"MisterG" <gl**********@r ogers.com> wrote in message
news:Ir******** ************@ro gers.com...
Using the following code I am able to open a new window when a user rightclicks an object in my document.

if (window.event.b utton == 2) {
Win1 = window.open("", "","height=200, width=200");
Win1.document.w rite('Right click!');
}
Only in IE. There is no attempt to make it work in browsers that
don't support window.event and it will be defeated by pop-up
blockers.

It likely won't work on systems that implement right mouse button
functionality without actually having one.

The problem is that the default menu that normally appears is still
appearing. How do I suppress the right-click menu?

Thank you
Glenn

Initially I did this by inserting a clear 1x1 px gif at the mouse point
while the mouse was down. There is an easier way to do it however by
canceling the event. Can't seem to remember the trick off the top of my head though. I should have a copy stored on my home computer...but in the mean time i found this:

http://www.javascriptkit.com/script/...lickmenu.shtml


That is IE specific code that does not work in any browser that does
not support "window.createP opup", that has a pop-up blocker enabled
or has JavaScript disabled.

Changing the default behaviour of the user's interface only creates
confusion, what is the point?
--
Zif

Jul 23 '05 #5
"MisterG" <gl**********@r ogers.com> wrote in message
news:Et******** ************@ro gers.com...
Thank you. That's all I needed!

"Matthew Hagston" <ot***@earthlin k.net> wrote in message
news:yf******** ******@newsread 2.news.atl.eart hlink.net...
"MisterG" <gl**********@r ogers.com> wrote in message
news:Ir******** ************@ro gers.com...
Using the following code I am able to open a new window when a user right clicks an object in my document.

if (window.event.b utton == 2) {
Win1 = window.open("", "","height=200, width=200");
Win1.document.w rite('Right click!');
}

The problem is that the default menu that normally appears is still
appearing. How do I suppress the right-click menu?

Thank you
Glenn


Initially I did this by inserting a clear 1x1 px gif at the mouse point
while the mouse was down. There is an easier way to do it however by
canceling the event. Can't seem to remember the trick off the top of my

head
though. I should have a copy stored on my home computer...but in the mean time i found this:

http://www.javascriptkit.com/script/...lickmenu.shtml

--
Matthew Hagston


Well, the one I designed worked on all sytems including opera (providing you
had javascript mouse events enabled). Haven't had time to find it yet
though. That was just given as an example of how to do it that i could find
easily on the net.

--
Matthew Hagston
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
32924
by: Anand Ganesh | last post by:
Hi All, When the user right clicks on the desktop or selects a file and right clicks the mouse he should see our own submenu along with the Windows context menu. How will I do this in Visual C# ? Any suggestions please? Thanks for your time
11
2567
by: Terry Olsen | last post by:
How can I catch a right-click on a DropDownMenuItem?
2
4846
by: Hardik Shah | last post by:
Hi, I want to create menu , when my user right click from combo box's list item. I use Contextmenu property of combobox and assign menu for it, but it only effected when combobox's list item not active. When my user on any combobox's item and he right click the mouse , menu doesn't appear. How to create menu. Thanks in advance.
5
2109
by: wxnut | last post by:
In VB 2005 I have six seperately named picture boxes (arranged in a table layout control) in which I plot different X/Y data lines. I would like to be able to right-click on a specific picture box (say, plot #3) and select a different line color for that one plot. How can I figure out which of the six plots is the one in question when right-clicking on it? I can easily change the line color using the context menu control, but I don't...
4
3137
by: Przemek M. Zawada | last post by:
Dear Group, I have written a software (C#/VS2005), which enter current directory, match all requested files and rename it recursively (removing special chars, etc). What I want is to add in right mouse click menu an item, ie. "Re-write this directory" when user clicks in ie. file explorer ($HOMEDIR/My Pictures via IE) right mouse button. This menu has items like: 'View, Sort, Copy, Paste, Cut, Delete, New --Submenu --New folder, New...
0
7965
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7885
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8380
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5426
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3923
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2399
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1231
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.